package cn.itsource.controller.app;

import cn.itsource.remote.pojo.param.AppLoginParam;
import cn.itsource.result.R;
import cn.itsource.service.ILoginService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Tag(name = "小程序登录表",description = "小程序登录表")
@RestController
@RequestMapping("/app/login")
public class AppLoginController {

    @Autowired
    public ILoginService loginService;

    @Operation(summary = "小程序保存Login", description = "小程序基础对象保存接口")
    @Parameter(name = "login", description = "保存的对象", required = true)
    @PostMapping("/appLoginInit")
    public R<Boolean> save(@RequestBody @Valid AppLoginParam appLoginParam) {
        loginService.appLoginInt(appLoginParam);
        return R.success();
    }
}

